<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>入门</title>
    <Script>
        //js的输出
        window.alert('你好，这是js的提示信息');
        document.write("您好，这段内容会在浏览器的body中直接显示。");
        console.log('在调试窗口中输出');
        document.write("<br>");

        //js的输入
        var username = window.prompt("请输入你的姓名");   //通常对用户的输入，使用一个变量来保存输入的值
        document.write('你输入的姓名为：' + username);
        document.write("<br>");

        var x = 100;
        var y = 200;
        var z = x + y
        document.write('z的值为：' + z);

        document.write("<a href='http://www.baidu.com'>百度</a>");
        document.write("<br>");

        //运算
        var number1 = 100;
        var number2 = 200;
        var number3 = '300';
        document.write(number1+number2); //300
        document.write("<br>");
        document.write(number1+number3); //100300
        document.write("<br>");
        document.write(number1+number2+number3); //300300
        document.write("<br>");
        document.write(number3+number2+number1); //300200100
        document.write("<br>");
        document.write(number3-number2-number1); //0      300-200-100=0
        document.write("<br>");
        document.write(number1*number2);//20000
        document.write("<br>");
        document.write(number1/number2);//0.5
        document.write("<br>");

        document.write(number1>number2);//false
        document.write("<br>");

        var c = null;
        var d = 100;
        document.write(c+d); //100
        document.write("<br>");
        // document.write(e); //控制台报错，变量未定义 

        
        var f;
        d = 100;
        document.write(f=d++); //f=100,d=101
        document.write("<br>");

        d = 100;
        document.write(f=++d); //f=101,d=101
        document.write("<br>");

        document.write(10>5 || 4>9); //true
        document.write("<br>");
        document.write(10>5 && 4>9); //false
        document.write("<br>");
        document.write(5=='5');//true
        document.write("<br>");
        document.write(5==='5');//false
        document.write("<br>");
        document.write(5!='5');//false
        document.write("<br>");
        document.write(5!=='5');//true
        document.write("<br>");







    </Script>
</head>
<body>
    
</body>
</html>